@import "../../../style/gn_search.less";
// variables for manipulating the theme
@import "gn_variables_default.less"; // must be last

.gn-row-results {
  padding-top: 15px;
  background-color: @gn-results-background-color;
}
.gn-row-tools {
  .btn-default, .pagination > li > a, .pagination > li > span {
    border-color: @panel-default-border !important;
    &:hover, &:active, &:focus {
      background-color: @panel-default-heading-bg !important;
      border-color: @btn-default-border !important;
      span {
        background: transparent;
      }
    }
  }
}

ul.gn-resultview, [data-gn-user-searches-list] {
  .gn-source-logo {
    margin-left: 5px;
    z-index: 10;
    height: 20px;
    float: right;
  }
}

// styling for all search results
ul.gn-resultview {
  @thumbnail-width: 140px;
  margin-right: -15px;
  
  .metadata {
    position: absolute;
    top: 0;
    width: 100%;
    width: 100%;
    height: 100%;
    z-index: 2050;
  }
  li.list-group-item {
    margin-right: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: none;
    &:hover {
      background-color: rgba(10, 10, 10, 0.05);
      cursor: default;
    }
    .row:first-of-type {
      padding-left: 3px;
    }
    
    .gn-md-thumbnail {
      .gn-img-thumbnail {
        max-width: @thumbnail-width;
        height: auto;
      }
    }
    .media {
      a {
        margin-left: 0;
        &.gn-md-edit-btn {
          width: 12px;
          margin-left: 10px;
          
        }
      }
      h4 {
        margin-top: 0;
        font-weight: 700;
        a {
          color: rgb(51, 51, 51);
        }
      }
    }
  }
  
  .gn-md-title {
    margin-top: 10px;
    overflow: hidden;
    cursor: pointer;
    h3 {
      margin-top: 0;
      line-height: 1.1em;
      a {
        font-weight: normal;
        font-size: 80%;
        color: #333333;
        text-overflow: ellipsis;
        overflow: hidden;
        display: block;
        display: -webkit-box;
        -webkit-line-clamp: 2;
      }
      a:hover {
        color: #428bca;
        text-decoration: none;
      }
    }
  }
  .gn-md-abstract {
    cursor: pointer;
    color: @gray-darker;
  }
  .gn-md-abstract.ellipsis:after {
    background: none;
  }
  
  li.gn-grid {
    @grid-bottom-margin: 2px;
    
    float: left;
    border: 1px solid @list-group-border;
    min-width: 300px;
    max-width: 500px;
    width: calc(~"100% - 15px");
    height: 24em;
    padding: 14px;
    .gn-md-details {
      color: #6a6a6a;
      max-height: 50px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    /* Properly align category icons */
    .fa img {
      vertical-align: text-bottom;
    }
    .gn-md-title {
      margin-bottom: 5px;
      min-height: 4em;
      max-height: 4em;
    }
    input {
      float: left;
    }
    .gn-md-links {
      background: none;
      padding: 5px;
    }
    [gn-grid-related] {
      padding: 5px;
      margin: 2px;
    }
    .gn-toolbar {
      position: absolute;
      bottom: 0px;
      right: 0px;
    }
    .gn-md-thumbnail {
      overflow: hidden;
      cursor: pointer;
      .gn-img-thumbnail {
        max-width: @thumbnail-width;
        max-height: 140px;
        min-height: 40px;
        height: auto;
      }
    }
    
    .gn-md-category {
      display: block;
      float: left;
      margin-left: 18px;
    }
  }
  li.gn-list {
    .gn-md-title {
      h1 {
        line-height: 1.3em;
        font-size: 20px;
        margin-top: 0;
        padding-top: 5px;
        a {
          color: #333;
          &:hover {
            color: #000;
          }
          .fa {
            display: inline;
          }
        }
        .md-title {
          display: block;
          float: right;
          width: calc(~"100% - 50px");
        }
      }
    }
    .gn-md-category {
      a {
        margin-left: 5px;
      }
    }
    .gn-md-logo {
      margin-top: 5px;
      img {
        max-width: 100%;
      }
    }
    .gn-md-thumbnail {
      border-radius: 0;
      margin-top: 5px;
    }
    .gn-status, .gn-workflow-status {
      position: relative;
      float: left;
      color: darken(@brand-info, 25%);
    }
    .gn-status-completed {
      color: darken(@brand-success, 20%);
    }
    .gn-status-historicalArchive {
      color: darken(@brand-warning, 20%);
    }
    .gn-status-obsolete {
      color: darken(@brand-danger, 20%);
    }
    .gn-workflow-status {
      background-color: rgba(255, 255, 255 , 0.7);
      border-color: darken(@brand-success, 5%);
      color: @brand-success;
    }
    /* Decide here which status should be displayed
    or not and with which colors */
    .gn-workingcopy-status {
      margin-top: 0;
      i {
        height: 34px;
        width: 34px;
        margin-top: -1px;
      }
    }
    .gn-md-abstract {
      p {
        font-size: 1em;
        color: @text-muted;
        &:empty {
          display: none;
        }
      }
      address {
        margin-bottom: 5px;
      }
      .collapse-text-toggle {
        color: @brand-primary;
      }
    }    
    .gn-md-links {
      background: 0;
      margin-top: 10px;
      border-bottom: 1px solid @list-group-border;
      padding-bottom: 10px;
      line-height: 1em;
      .btn {
        margin-right: 5px;
        .caret {
          margin-left: 3px;
        }
      }
    }
    &:hover {
      background-color: rgba(240, 240, 240, 0.5)
    }
  }
}

/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */

/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) {
  ul.gn-resultview li.gn-grid {
    width: calc(~"100% - 15px");
  }
}

/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-md-min) {
  
  ul.gn-resultview li.gn-grid {
    width: calc(~"50% - 15px");
  }
}

/* Large devices (large desktops, 1200px and up) */
@media (min-width: @screen-lg-min) {
  
  ul.gn-resultview li.gn-grid {
    //width: calc(~"33% - 15px");
  }
}

// nojs styles
.gn-nojs {
  .gn-resultview {
    .clearfix();
    padding-bottom: 50px;
    .list-group-item.gn-grid {
      border: 0;
      border-bottom: 1px solid #ddd;
      margin-bottom: 0;
      width: 100%;
      max-width: none;
      height: auto;
      border-radius: 0;
      .gn-md-title {
        min-height: 0;
        max-height: none;
      }
      h1 {
        margin: 0 0 20px 0;
        font-size: 20px;
        a {
          color: #333;
        }
        &.view-header {
          margin: 5px 0 15px 0;
        }
      }
      .gn-md-thumbnail {
        border: 1px solid #ddd;
        margin-right: 10px;
        height: auto;
        margin-top: 5px;
        border-radius: 2px;
        img {
          max-width: 200px;
        }
      }
      p {
        line-height: 1.6em;
        font-size: 1em;
      }
    }
  }
}
